<!DOCTYPE html>
<html lang='zh-CN'>

<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="bootstrap.min.css" rel="stylesheet">
    <title>玩者荣耀_主页</title>

    <style>
        h2 {
            font-size: xx-small;
        }
    </style>
</head>

<body>


    <div class="container-fluid text-center">
        <nav class="navbar navbar-expand-lg bg-light">
            <div class="container-fluid">
                <div class="btn-group">
                    <!-- <img src="home.png" alt="Logo" width="48" height="48" class="d-inline-block align-text-center"> -->

                    <!-- <button class="btn dropdown-toggle  align-text-center dropdown-toggle-split"
                        data-bs-toggle="dropdown" aria-expanded="false">新手村</button> -->

                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="index.html">首页</a></li>
                       
                    </ul>
                </div>

                <!-- <div> <span id="tips">人数:1 </span> <button class="btn btn-success" disabled id="placeBtn">更多</button>
                </div> -->

                <!-- Example split danger button -->
                <div class="btn-group">
                    <button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split"
                        data-bs-toggle="dropdown" aria-expanded="false">
                        菜单
                    </button>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="index.html" >首页</a></li>
                     
                    </ul>
                </div>
            </div>
        </nav>
        <div class="modal fade modal-fullscreen" id="mymodal" data-bs-keyboard="false" tabindex="-1"
            aria-labelledby="staticBackdropLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">

                    <div class="modal-body">
                        <div id="info"></div>
                    </div>

                </div>
            </div>
        </div>

        <div class="modal fade" id="msgmodal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
            aria-labelledby="staticBackdropLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="staticBackdropLabel">发言</h5>
                    </div>
                    <div class="modal-body">
                        <input type="text" maxlength="20" class="form-control" id="msgInput">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary" data-bs-dismiss="modal">确定</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade" id="renamemodal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
        aria-labelledby="staticBackdropLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="staticBackdropLabel">改名(限时免费)</h5>
                </div>
                <div class="modal-body">
                    <input type="text" maxlength="5" class="form-control" id="nameInput">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-bs-dismiss="modal">确定</button>
                </div>
            </div>
        </div>
    </div>
        <div class="modal fade " id="bagmodal" data-bs-keyboard="false" tabindex="-1"
            aria-labelledby="staticBackdropLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-scrollable">

                <div class="modal-content">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
                    <div class="modal-body">

                        <table class="table">

                            <tbody id="tbd">
                                <tr>
                                    <td scope="row">物品</td>
                                    <td>数量</td>
                                    <td>操作</td>
                                </tr>



                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
        <span id="puser" class="fs-1"></span>
        <!-- <button class="btn btn-success" onclick="btnFunc('rename')" id="renameBtn">改名</button> -->
        <p>
            <a class="btn btn-primary" data-bs-toggle="collapse" href="#collapseExample" role="button"
                aria-expanded="false" aria-controls="collapseExample">
                个人信息
            </a>

        </p>
        <div class="collapse" id="collapseExample">
            <div class="card card-body">
                <div id="infoBase" class="fs-6"></div>
            </div>
        </div>

     

        <hr />
       
     

    </div>
    <script src="popper.min.js"></script>
    <script src="bootstrap.min.js"></script>
    <script src="jquery-3.6.0.min.js"></script>
    <script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
</body>

<script>
    var url = "https://2020cn.cn/hop/api/user_mgr";
    var goodsList = [];
    var checkedInfoBase = true;
    $(document).ready(function () {
        if ($.cookie("hop_user_id") == null) {
            alert("请登录!");
            window.location.href = "index.html";
            return;
        }

        var user_id = $.cookie('hop_user_id');
        $.post(
            url,
            {
                "action": "getUserInfoAll",
                "user_id": user_id
            },
            function (res) {

                const resobj = JSON.parse(res);
                console.log(resobj.data[0])
                var ele = (resobj.data)[0];
                $.cookie("hop_user", JSON.stringify(ele), { expires: 7 });
                //console.log(ele)
                var infoBaseStr = [
                "<h2>账号:" + (ele.account) + "</h2>",
                "<h2>余额:" + ele.coin + "</h2>",
                "<h2>提现中的余额：" + (parseInt(ele.cash_coin)) + "</h2>",
                "<h2>名字：" + (ele.name) + "</h2>",
                "<h2>收款方式：" + (ele.payment_method) + "</h2>",
                "<h2>收款二维码:" + (ele.payment_qrcode) + "</h2>"].join("\n");
              
             
                var nodeInfoBase = $(infoBaseStr);
              
                $("#infoBase").append(nodeInfoBase);
                $('#puser')[0].innerHTML = "欢迎:" + ele.account;

            }
        );
        });

</script>

</html>